<?php

namespace App\Http\Controllers\Drivers\V2\Common;
use App\Http\Controllers\Controller;
use App\Services\UploadService;
use Illuminate\Http\Request;

class UploadController extends Controller
{
    protected $service;

    public function __construct()
    {
        $this->service = new UploadService();
    }
    /**
     * 图片上传
     *
     *
     * @param Request $request
     * @return UploadController|\Illuminate\Http\JsonResponse
     * @throws \App\Exceptions\BobException
     * @author Bob(bobcoder@qq.com)
     */
    public function uploadImg(Request $request)
    {
        $file = $request->file('file'); //文件

        $data = $this->service->upload($file);

        return $this->sendJson($data);
    }
}
